<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
﻿﻿﻿<script src="/Public/jsLibrary/jquery/jquery.js"></script>
<script src="/Public/jsLibrary/Jslibary.js"></script>

<link href="/guanli/Inc/Css.css" rel="stylesheet" type="text/css" />
<title>房型及价格</title>
</head>
<body>
<div><strong><a href="">进入本酒店所有的房型列表</a></strong></div>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <form action="<{:U('price/saveroomprice')}>" method="post" name="editpriceform" id="editpriceform">
  <tr>
    <td width="32%" height="45" valign="top">
   <div><strong>请选择下面的一个出发时间段修改:</strong></div>
   <select name="chufaduan" size="1"  id="chufaduan">
  	<option value="">请选择...</option>
   <volist name="rsprice" id="vo">
        	<option 
            <if condition="$pid eq $vo['price0']"> selected="selected"</if>
             value="<{$vo.price0}>"><{$vo.price1}></option>
   </volist> 
   </select> 
   <div><br>
   <a href="<{:U('hotelroom/edithotelprice')}>/rid/<{$rid}>">点击添加新的时间段:</a></div>
    </td>
    <td width="68%" height="45" valign="top">
   <div><strong>房型：<{$rs.hotelroom1}></strong>(<span style="color:#F00" id="thischufaname"><{$thisv.price1}></span>)</div>
    <div>时间段名称:<input type="text" value="<{$thisv.price1}>" name="chufaname" id="chufaname" size="32"></div>
     <div>起始时间:<input readonly="readonly" type="text" value="<{$thisv.price13|date="Y-m-d",###}>"  name="starttime" id="starttime" size="12" onClick="showCal(this);"></div>
     <div>结束时间:<input readonly="readonly" type="text" value="<{$thisv.price14|date="Y-m-d",###}>" name="overtime" id="overtime" size="12" onClick="showCal(this);"></div>
      <div>市场价:<input type="text" value="<{$thisv.price8}>" name="martkprice" id="martkprice" size="12"></div>
      <div>本站价:<input type="text" value="<{$thisv.price9}>" name="myprice" id="myprice" size="12"></div>
      <div>房 差:<input type="text" value="<{$thisv.price11}>" name="fangcha" id="fangcha" size="12"></div>
      <div>可预定间数:<input type="text" value="<{$thisv.price12}>" name="kucun" id="kucun" size="12"></div>
     <input type="button" value="修 改" name="mysubmit" id="mysubmit"> <input type="button" value="删 除"  id="mybuttom" name="mybuttom"  /></td>
  </tr>
  <input type="hidden" name="thisindex" id="thisindex" value="<{$thisv.price0}>"><!--显示当前正在修改的值-->
 <input type="hidden" name="rid" id="rid" value="<{$rid}>">
  </form>
</table>
<script language="javascript">
	$(document).ready(function(){
		//var checkText=$("#chufaduan").find("option:selected").text();//获取选中的值,以便于右边计算

		//给选择出发时间段的select绑定一个事件
		$("#chufaduan").change(function(){
			checkIndex=$("#chufaduan").val()
			window.location.href="/guanli/u.php/hotelroom/edithotelprice/rid/<{$rid}>/pid/"+checkIndex;
			
		});
		
		//验证提交时数据
		$("#mysubmit").bind("click",function(){
			chufaname=$("#chufaname").val();
			
			if(!nzeletype("chufaname","时间段名不能为空","string")) return false;
			if(!nzeletype("starttime","起始时间不能为空","date")) return false;
			if(!nzeletype("overtime","结束时间不能为空","date")) return false;
			if(!nzeletype("martkprice","请输入正确的市场价","float")) return false;
			if(!nzeletype("myprice","请输入正确的梦之旅价","float")) return false;
			if(!nzeletype("fangcha","请输入正确的房差，没有可填写0","int")) return false;
			if(!nzeletype("kucun","请输入正确的可预定房间数,没有可填写0","int")) return false;
			
			//下一步比较值的合理性
			$("#editpriceform").submit();
			return false;
		});
		
		//================================初始化表单值
		//当没有出发时间段时.做为新的值添加
		var initpid="<{$pid}>";
		if(initpid==""){
			$("#starttime").val("");
			$("#overtime").val("");
			$("#thischufaname").html("  加新的时间段值");
			$("#mysubmit").val("添 加");
			$("#mybuttom").hide();
		}
		

		
	});

</script>


</body>
</html>
